<template>
	<view class="totle">
		<view class="loginIng">
			<image :src=NowUserInfo.img[0] style="border-radius:50%;width: 150rpx;height: 150rpx;"></image>
			<view style="display: flex;flex-direction: column;">
				<p class="userNickName" style="font-weight: bold; font-size: 40rpx;">{{NowUserInfo.nickName}}</p>
				<p class="" style="padding-left: 30rpx;">用户等级：{{NowUserInfo.img.length}}</p>
			</view>

		</view>
		<view class="userService">
			<view class="myInfo" @click="routeFavorites">
				<image src="../static/icon/tabbar/shoucang.png" mode="" style="width: 60rpx;height: 60rpx;"></image>
				<p style="display: block;">收藏</p>
			</view>
			<view @click="toaddAddress" class="myInfo">
				<image src="../static/icon/tabbar/address.png" mode="" style="width: 60rpx;height: 60rpx;"></image>
				<p style="display: block;">地址管理</p>
			</view>
			<view class="myInfo">
				<image src="../static/icon/tabbar/hot.png" mode="" style="width: 60rpx;height: 60rpx;"></image>
				<p style="display: block;">热度</p>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		name: "mine-totle",
		created() {
			//生命周期钩子函数获取本地数据
			const usersNow = this.$store.state.user;
			console.log(usersNow)
			this.NowUserInfo = usersNow;
			console.log(this.NowUserInfo)
		},
		data() {
			return {
				renderState: false,
				NowUserInfo: {
					UserImgUrl: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.yao51.com%2Fjiankangtuku%2Fgkhpkdckgv.jpeg&refer=http%3A%2F%2Fimg.yao51.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1624157047&t=df8cb130d721e349318af1a11bfdf5e3",
				}
			};
		},
		methods: {
			// 跳转收藏页面
			routeFavorites() {
				uni.navigateTo({
					url: '/pages/favorite/favorite',
				})
			},
			toaddAddress(){
				uni.navigateTo({
					url: '/pages/address/address',
				})
			}
			// WXlogin() {
			// 	uni.getUserProfile({
			// 		// 获取用户登录信息
			// 		desc: "login",
			// 		lang: "zh_CN",
			// 		success: ({
			// 			userInfo
			// 		}) => {
			// 			this.renderState = true;
			// 			this.NowUserInfo = userInfo;
			// 			console.log(this.NowUserInfo)
			// 			this.NowUserInfo.UserImgUrl = userInfo.avatarUrl;
			// 			uni.setStorage('userData', userInfo);
			// 		}
			// 	});
			// },

		},
	}
</script>

<style>
	.login {
		display: inline-block;
		width: 100rpx;
		height: 50rpx;
		line-height: 50rpx;
	}

	.logined {
		padding-top: 150rpx;
		display: flex;
		justify-content: center;
		line-height: 150rpx;
	}

	.totle {
		width: 100%;
		height: 350rpx;
		background-color: #78cdd1;
	}

	.loginIng {
		padding-left: 30rpx;
		display: flex;
		align-items: center;
		text-align: center;
	}

	.userNickName {
		display: inline-block;
		text-align: center;
		margin-left: 20rpx;
		line-height: 100rpx;
	}

	.userService {
		display: flex;
		font-size: 26rpx;
		margin-top: 40rpx;
		justify-content: space-around;
	}

	.myInfo {
		text-align: center;
	}
</style>
